"""
      Longest-Rapidly-Increasing(A[1, ..., n])
          M[1, ..., n^2/2] = 0
          i = 1
          For i, ..., n-1
              j = i
              P[1, ..., n] = 0
              For j, ..., n-1
                  If 2A[j] $\leq$ A[j+1]
                      P[i].push(A[j])
              M[i] = P
          S = max(M)
          return S
"""


# def get_largest_rapidly_increasing(my_list):
#     if len(my_list) < 2:
#         return my_list
#     list_of_lists = []
#     for i, _ in enumerate(my_list):
#         p_list = []
#         p_list.append(my_list[i])
#         for j, _ in enumerate(my_list[:-1]):
#             if (2 * my_list[j]) <= my_list[j + 1]:
#                 p_list.append(my_list[j + 1])

#         print(p_list)
#         list_of_lists.append(p_list)

#     longest_list = max(list_of_lists, key=len)
#     return longest_list


def get_largest_rapidly_increasing(numbers):
    if len(numbers) < 2:
        return numbers

    longest_seq = []

    for i in range(len(numbers)):
        current_seq = [numbers[i]]
        for j in range(i + 1, len(numbers)):
            if current_seq[-1] < 0.5 * numbers[j]:
                current_seq.append(numbers[j])
            else:
                break
        if len(current_seq) > len(longest_seq):
            longest_seq = current_seq

    return longest_seq
